<template>
  <img :src="imgsrc" alt :width="w" :height="h" style="cursor:pointer;" @click="checkCode_img" />
</template>
<script>
export default {
  data() {
    return {
      imgsrc: "",
      w: 100,
      h: 32,
      key: ""
    };
  },
  created: function() {
    this.checkCode_img();
  },
  methods: {
    checkCode_img() {
      this.$api.userAPI.getVerify(this.key).then(res => {
        this.imgsrc = "data:image/png;base64," + res.data.b64;
        this.key = res.data.code;
        this.$store.commit("updataCodeKey", res.data.code);
        
      });
    }
  }
};
</script>
